package com.bjbn.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 短信响应DTO
 */
@Data
@Schema(description = "短信发送响应")
public class SmsResponseDto {
    
    /**
     * 响应码：0成功，非0失败
     */
    @Schema(description = "响应码，0成功，非0失败", example = "0")
    private Integer code;
    
    /**
     * 响应消息
     */
    @Schema(description = "响应消息", example = "发送成功")
    private String message;
    
    /**
     * 消息批次号
     */
    @Schema(description = "消息批次号", example = "20231201123456789")
    private String groupId;
    
    /**
     * 是否成功
     */
    @Schema(description = "是否成功", example = "true")
    private Boolean success;
    
    /**
     * 构造成功响应
     */
    public static SmsResponseDto success(String groupId) {
        SmsResponseDto response = new SmsResponseDto();
        response.setCode(0);
        response.setMessage("发送成功");
        response.setGroupId(groupId);
        response.setSuccess(true);
        return response;
    }
    
    /**
     * 构造失败响应
     */
    public static SmsResponseDto error(Integer code, String message) {
        SmsResponseDto response = new SmsResponseDto();
        response.setCode(code);
        response.setMessage(message);
        response.setSuccess(false);
        return response;
    }
} 